// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新增事件定义 POST /event/add */
export async function eventControllerAddEventInfo(
  body: API.AddEventReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/event/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除事件定义 DELETE /event/batchDel */
export async function eventControllerBatchDelEventInfo(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/event/batchDel`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除事件定义 DELETE /event/del/${param0} */
export async function eventControllerDelEventInfo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.eventControllerDelEventInfoParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ApiResult>(`${apiPrefix}/event/del/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 编辑事件定义 PUT /event/edit */
export async function eventControllerEditEventInfo(
  body: API.EditEventReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/event/edit`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询事件定义列表 GET /event/list */
export async function eventControllerGetPageList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.eventControllerGetPageListParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/event/list`, {
    method: 'GET',
    params: {
      ...params,
      req: undefined,
      ...params['req'],
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}
